package com.start.avue.mapper;


import com.alibaba.fastjson2.JSONObject;
import com.start.avue.tools.AvueTools;

import java.util.Map;

public class AvueTableMapper extends AvueBaseDicDataMapper {
    private Map<String, String> valueDic;
    private Map<String, String> labelDic;
    private String valueLoadUrl;
    private String valueKey = "#{valueKey}";
    private String labelLoadUrl;
    private String labelKey = "#{labelKey}";

    @Override
    public void init(String startHomeUrl, JSONObject column, Map<String, String> headers) {
        super.init(startHomeUrl, column, headers);
        String valueLoadUrl = column.getString("valueLoadUrl");
        this.valueLoadUrl = AvueTools.analysisUrl(startHomeUrl, valueLoadUrl);
        this.valueLoadUrl = AvueTools.analysisUrl(startHomeUrl, valueLoadUrl);
        String labelLoadUrl = column.getString("labelLoadUrl");
        this.labelLoadUrl = AvueTools.analysisUrl(startHomeUrl, labelLoadUrl);
    }

    @Override
    public Object labelToValue(String label) {

        return super.labelToValue(label);
    }

    @Override
    public Object valueToLabel(Object value) {
        String valStr = String.valueOf(value);
        if (!AvueTools.strIsJson(valStr)) {

        }
        return valStr;
    }
}
